package com.wems.farm_manage.service.impl;

import java.util.List;
import com.wems.common.utils.DateUtils;
import com.wems.farm_manage.domain.vo.DeptFarmMappingVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wems.farm_manage.mapper.DeptFarmMappingMapper;
import com.wems.farm_manage.domain.DeptFarmMapping;
import com.wems.farm_manage.service.IDeptFarmMappingService;

/**
 * 部门风场对应关系Service业务层处理
 * 
 * @author MPC
 * @date 2025-05-16
 */
@Service
public class DeptFarmMappingServiceImpl implements IDeptFarmMappingService 
{
    @Autowired
    private DeptFarmMappingMapper deptFarmMappingMapper;

    /**
     * 查询部门风场对应关系
     * 
     * @param id 部门风场对应关系主键
     * @return 部门风场对应关系
     */
    @Override
    public DeptFarmMapping selectDeptFarmMappingById(Long id)
    {
        return deptFarmMappingMapper.selectDeptFarmMappingById(id);
    }

    /**
     * 查询部门风场对应关系列表
     * 
     * @param deptFarmMapping 部门风场对应关系
     * @return 部门风场对应关系
     */
    @Override
    public List<DeptFarmMapping> selectDeptFarmMappingList(DeptFarmMapping deptFarmMapping)
    {
        return deptFarmMappingMapper.selectDeptFarmMappingList(deptFarmMapping);
    }

    /**
     * 新增部门风场对应关系
     * 
     * @param deptFarmMapping 部门风场对应关系
     * @return 结果
     */
    @Override
    public int insertDeptFarmMapping(DeptFarmMapping deptFarmMapping)
    {
        deptFarmMapping.setCreateTime(DateUtils.getNowDate());
        return deptFarmMappingMapper.insertDeptFarmMapping(deptFarmMapping);
    }

    /**
     * 修改部门风场对应关系
     * 
     * @param deptFarmMapping 部门风场对应关系
     * @return 结果
     */
    @Override
    public int updateDeptFarmMapping(DeptFarmMapping deptFarmMapping)
    {
        deptFarmMapping.setUpdateTime(DateUtils.getNowDate());
        return deptFarmMappingMapper.updateDeptFarmMapping(deptFarmMapping);
    }

    /**
     * 批量删除部门风场对应关系
     * 
     * @param ids 需要删除的部门风场对应关系主键
     * @return 结果
     */
    @Override
    public int deleteDeptFarmMappingByIds(Long[] ids)
    {
        return deptFarmMappingMapper.deleteDeptFarmMappingByIds(ids);
    }

    /**
     * 删除部门风场对应关系信息
     * 
     * @param id 部门风场对应关系主键
     * @return 结果
     */
    @Override
    public int deleteDeptFarmMappingById(Long id)
    {
        return deptFarmMappingMapper.deleteDeptFarmMappingById(id);
    }

    /**
     * 查询部门风场对应关系列表
     *
     * @param deptFarmMapping 部门风场对应关系
     * @return 部门风场对应关系Vo集合
     */
    public List<DeptFarmMappingVo> selectDeptFarmMappingVoList(DeptFarmMapping deptFarmMapping){
        return deptFarmMappingMapper.selectDeptFarmMappingVoList(deptFarmMapping);
    }
}
